<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%--头部内容开始--%>
<jsp:include page="head.jsp"/>
<%--头部内容结束--%>
<%--中间内容开始--%>
<div class="layui-container fly-marginTop fly-user-main">
    <jsp:include page="manger_left.jsp"/>


    <div class="fly-panel fly-panel-user" pad20>

        <div class="layui-form layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title" id="LAY_mine">
                <li data-type="mine-jie" lay-id="index"><a href="${pageContext.request.contextPath}/blog/student/to_msgCommList.do?currentPage=1">评论我的</a></li>
                <li data-type="mine-jie" lay-id="index" class="layui-this">回复我的</li>
            </ul>
            <c:if test="${replylist.size()!=0}">
                <div class="layui-tab-content" style="padding: 20px 0;">
                    <div class="layui-tab-item layui-show">
                        <ul class="mine-view jie-row">
                            <c:forEach items="${replylist}" var="reply">
                                <li>
                                    <a class="mine-edit" href="">${reply.user.uType}</a>
                                    <a class="jie-title" href="" class="fly-link">
                                        &nbsp;&nbsp;${reply.user.uNickName}
                                    </a>
                                    <i>回复了你的评论&nbsp;&nbsp;&nbsp;</i>
                                    <a class="jie-title" href="${pageContext.request.contextPath}/blog/ReplyState.do?bId=${reply.rBId}&&rId=${reply.rId}" target="_blank">${reply.blog.bTitle}</a>

                                    <i><spring:eval expression="reply.rCreateTime"/></i>

                                    <em>
                                        <%--<span class="layui-badge-dot"></span>--%>
                                        <%--<a class="mine-edit" href="${pageContext.request.contextPath}/blog/student/to_update.do?bId=${comment.bId}">查看</a>--%>
                                            <%--<a class="mine-edit layui-bg-red" href="${pageContext.request.contextPath
                                            }/blog/student/remove.do?bId=${blog.bId}">删除</a>--%>
                                       <%-- <a href="javascript:;" class="mine-edit layui-bg-red  del" rel="external nofollow" data-bid="${comment.cId}" data-opt="del">删除</a>--%>
                                    </em>
                                </li>

                            </c:forEach>

                        </ul>
                            <%--分页--%>
                        <form action="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do" method="post">
                            <div style="text-align: center">
                                <div class="laypage-main">
                                    <c:if test="${pageInfo.hasPrePage}">
                                        <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=1">首页</a>
                                        <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPag=${pageInfo.currentPage-1}">上一页</a>
                                    </c:if>
                                    <c:if test="${pageInfo.hasPrePage==false}">
                                        <span>首页</span>
                                        <span>上一页</span>
                                    </c:if>
                                    <c:choose>
                                        <c:when test="${pageInfo.totalPage>5}">
                                            <c:forEach var="count" begin="1" end="5">
                                                <c:if  test="${pageInfo.currentPage==count}">
                                                    <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=${count}" class="laypage-curr">${count}</a>
                                                </c:if>
                                                <c:if test="${pageInfo.currentPage!=count}">
                                                    <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=${count}</a>
                                                </c:if>
                                            </c:forEach>
                                            <span>…</span>
                                        </c:when>
                                        <c:when test="${pageInfo.totalPage<=5}">
                                            <c:forEach var="count" begin="1" end="${pageInfo.totalPage}">
                                                <c:if test="${pageInfo.currentPage!=count}">
                                                    <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=${count}">${count}</a>
                                                </c:if>
                                                <c:if  test="${pageInfo.currentPage==count}">
                                                    <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=${count}" class="laypage-curr">${count}</a>
                                                </c:if>
                                            </c:forEach>
                                        </c:when>
                                    </c:choose>

                                    <c:if test="${pageInfo.hasNextPage}">
                                        <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=${pageInfo.currentPage+1}">下一页</a>
                                        <a href="${pageContext.request.contextPath}/blog/student/to_msgCommReplyList.do?currentPage=${pageInfo.totalPage}">尾页</a>
                                    </c:if>
                                    <c:if test="${pageInfo.hasNextPage==false}">
                                        <span> 下一页</span>
                                        <span> 尾页</span>
                                    </c:if>
                                </div>
                                <div class="laypage-main" >
                                    <cite> 共${pageInfo.totalPage}页</cite>
                                </div>
                                <span style="height: 100%; text-align: center;">
                        <div class="layui-inline" style="margin-top: 20px;margin-left: 2px; margin-right: 2px;">
                            <cite>到第</cite>
                            <div class="layui-input-inline" style="width: 50px;">
                              <input type="text" name="currentPage" id="currentPage" autocomplete="off" class="layui-input" lay-verify="required|check_CurrentPage">
                              <input type="hidden" name="totalPage" id="totalPage" class="layui-input" value="${pageInfo.totalPage}">
                            </div>
                            <cite>页</cite>
				        </div>
                        <button type="submit" class="layui-btn" lay-filter="*" lay-submit style="margin-top: 20px;">确定</button>
		            </span>
                                <div style="height: 10px;"></div>
                            </div>
                        </form>
                            <%--分页结束--%>
                        <div id="LAY_page"></div>
                    </div>
                </div>
            </c:if>
            <c:if test="${replylist.size()==0}">
                <div class="fly-none"><img src="${pageContext.request.contextPath}/img/none.png"><h2>还没有评论回复哟！</h2></div>
            </c:if>
        </div>
    </div>
</div>
<%--中间内容结束--%>
<%--底部内容开始--%>
<jsp:include page="bottom.jsp"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.3.1.js" ></script>
<%--底部内容结束--%>
<script>
    layui.use(['form','jquery'],function(){
        var form = layui.form,
            $ = layui.$;
    });
    layui.use([ 'form' ], function() {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;
        /* 自定义表单验证 */
        form.verify({
            check_CurrentPage : function(value, item) {
                var totalPage = $("#totalPage").val();
                if(value > totalPage || value==0){
                    return "请重新输入！";
                }
            }

        });
    });

</script>